import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-08-24
 * Time: 10:25
 */
/*public class TestDemo {
    public static void main(String[] args) {
       double weight;
       double height;

        Scanner scanner =new Scanner(System.in);
        while(scanner.hasNext()){
            weight=scanner.nextDouble();
            height=scanner.nextDouble();
            double BMI=weight/(height*height);
            System.out.println("您的BMI是"+BMI);
        }


    }
}*/
public ListNode deleteNode (ListNode head, int val) {
        // write c ode here
        ListNode cur=head;
        if(head.val==val){
        return head.next;
        }

        while(&&head.next.val!=val){
        head=head.next;

        }
        head.next=head.next.next;
        return cur;
        }

        }
